#!/bin/sh
cd ${0%/*} || exit 1    # Run from this directory

# Parse arguments for compilation (at least for error catching)
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments

unset COMP_FLAGS LINK_FLAGS

# Use readline if available
if [ -f /usr/include/readline/readline.h ]
then
    echo "    found <readline/readline.h>  --  enabling readline support."
    export COMP_FLAGS="-DHAS_READLINE"

    # readline may require ncurses
    if [ -f /usr/include/ncurses/ncurses.h ]
    then
        echo "    found <ncurses/ncurses.h>  --  maybe required by readline."
        export LINK_FLAGS="-lreadline -lncurses"
    else
        export LINK_FLAGS="-lreadline"
    fi
fi

wmake $targetType

#------------------------------------------------------------------------------
